const express = require('express')
//导入gzip
const compression = require('compression')

//导入https
//const https = require('https')
//const fs = require('fs')

//创建web服务器
const app = express()

//读取文件
// const options = {
//   cert: fs.readFileSync('./full_chain.pem'),
//   key: fs.readFileSync('./private.key')
// }

// 一定要把这一行代码，写到 静态资源托管之前
app.use(compression())
//托管静态资源
app.use(express.static('./dist'))

//启动本地服务端口
app.listen(8099, () => {
  console.log('server running at http://127.0.0.1:8099')
})

//配置https模块；默认是443端口
// https.createServer(options, app).listen(443)
